<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="(item,index) in data">
      <img :src="item" alt="" @load="imgLoad">
    </van-swipe-item>
  </van-swipe>
  </div>
</template>

<script>
import { Swipe, SwipeItem } from "vant";
export default {
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem
  },
  props:{
    data:{
      type:Array,
      default(){
        return []
      }
    }
  },
  data() {
    return {
      is:true
    }
  },
  methods: {
    imgLoad(){
      if(this.is){
        this.$emit('imgLoad')
        this.is=false
      }
    }
  },
};
</script>

<style scoped>
img{
  width: 100%;
  
}
</style>